// maindlg.h : interface of the CMainDlg class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINDLG_H__B51C02D8_92E0_4449_BC08_6EDF5E8D696C__INCLUDED_)
#define AFX_MAINDLG_H__B51C02D8_92E0_4449_BC08_6EDF5E8D696C__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000


class CComboBoxImpl : public CWindowImpl<CComboBoxImpl, CComboBox>
{
	BEGIN_MSG_MAP(CComboBoxImpl)		
	END_MSG_MAP()
};

class CIPAddressCtrlImpl : public CWindowImpl<CIPAddressCtrlImpl, CIPAddressCtrl>
{
	BEGIN_MSG_MAP(CIPAddressCtrlImpl)		
	END_MSG_MAP()
};


class CMainDlg : public CDialogImpl<CMainDlg>, public CWinDataExchange<CMainDlg>, public CUpdateUI<CMainDlg>,
		public CMessageFilter, public CIdleHandler
{
public:
	enum { IDD = IDD_MAINDLG };

	BEGIN_UPDATE_UI_MAP(CMainDlg)
	END_UPDATE_UI_MAP()

	BEGIN_MSG_MAP(CMainDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
		COMMAND_ID_HANDLER(IDOK, OnOK)
		COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		COMMAND_HANDLER(IDC_COMBO1, CBN_SELCHANGE, OnSelchange)
		COMMAND_HANDLER(IDC_BUTTON1, BN_CLICKED, OnClickedButton1)
		COMMAND_HANDLER(IDC_BUTTON2, BN_CLICKED, OnClickedButton2)
	END_MSG_MAP()

	BEGIN_DDX_MAP(CMainDlg)
		DDX_CONTROL(IDC_COMBO1, m_ComBox)
		DDX_CONTROL(IDC_IPADDRESS1, m_IPAddrCtrl[0])
		DDX_CONTROL(IDC_IPADDRESS2, m_IPAddrCtrl[1])
		DDX_CONTROL(IDC_IPADDRESS3, m_IPAddrCtrl[2])
		DDX_CONTROL(IDC_IPADDRESS4, m_IPAddrCtrl[3])
	END_DDX_MAP()

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnSelchange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnClickedButton1(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnClickedButton2(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);

	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual BOOL OnIdle();

private:
	vector<ADAPTER_INFO*> m_vAdapterInfo;
	CComboBoxImpl m_ComBox;
	int m_nCurSec;
	CIPAddressCtrlImpl m_IPAddrCtrl[4];
	string m_strIPAddr[4];
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINDLG_H__B51C02D8_92E0_4449_BC08_6EDF5E8D696C__INCLUDED_)
